fixed minor issue, handler declarations must be at the end of declaration block