fix for static files and 500 error for debug mode = false