added a check for existence of num, fixes #458