added check to inputmanager keyboard add/remove methods to check if domnode is valid