fixed label lookup and added test