Fix for 400 errors when deployed