Getting rid of 500 error