fix : Notice: Undefined offset error