fixed issue 1334, thanks Jonathan Bohren