fixed bad return bug