Fixed a bug in the streamhandler timer