fix from michael's code review