fix bug in handler