bugfix: UnboundLocalError: local variable 'now' referenced before assignment