fixed the bug mentioned in a comment to the previous commit :)