working on better error handling.