use ualarm() instead of alarm()