fix for 500 error