Added UnboundLocalError with code 500-12.