fixed bug for delete state and error message in role