add extra guards in new functionality