removed hard-coded "error" string and updated comments