bug for returning results fixed