on 500 write error string