fix for 500 errors