exception handling - still not working fully