fix for bug looking at return value