Out of range error fixed