fix return value issue and class isue