fix check for name valid after module detection