fix for some exception order bugs