throwing the exception instead of printing stack trace in the stder