bugfix, (found using cppcheck)