fix an error 500 for this ajax handler