fixed major error that was crashing the server because of ajax