fixed missing exception handling