finally fixed nagging traceback with Nick's help