prevent ajax errors

prevent ajax errors