one could register this in plugin.cpp and avoid the check