moved exceptions to handler