for loop fixed and used filter instead of get