Added a fix for the 500 error