error handlings for 500 char max limit

error is handled at various places