added custom exception handling
better error message