Fixing timer bug