Fixes 500 errors