Fixes bug in previous commit which failed to cast the currentPanel value to a number.