modified handler.h and handler.c