fixed some return code