debugged 500 error