removed some improper error handling.