optimized timer handler, fixed beeping