minor bug fix found by nick