working on error handling.