find layer based on function