fix genref and cmd