I have this function in a class where I have a condition that as an int param, without the contion where the query return corretly, but it this contiton it return the following