solved array comparsion problem