Removed debug print and added better exception printing