added better exception handling and updated specs for travis