Added isNull check for commandmap