wrong order in exception handling