Fix for timer bug