Fixed Cppcheck warning. Made method const