add one condition for checking is array