fix the attend code 500 error