fix bugs that catch error