Fixed bug in alarm