array handling added