adding additional logging for 500 errors