fix return type switching