add remove & error code to erlang