fix return type and clarify logging