updated to capture errors and display. needs to be prettier.