Changes to accommodate exception handling. TODO catch block, hard coded
at the moment.