fixed error found by Lloyd