Fix crash in release build. Added helper method