fixes some bugs,handler error's input