fixing lamba function