fixed error messages when giving a negative index to an array