fix exception handling and usage