Fixing memory leak in Timer