refactored item create method and removed out of range error