fixed error with first element