bug fix, thanks turland