fix bug: crash when spend = None