Bug in returning results