implement alarm method.