I'm not really sure what you are trying to do.
But a problem is definitly, that you setup a timer with the return code of deliver, which according to the documentation doesn't return anything useful. Therefore it returns anything at all it should not be used as a callback for a timer.