Updated error handling
Updated send() method