fix problem in function return values