try catch block was hiding an exception