fixed some styling and error handling