adding if when queryresult is empty