fixed circular dependency bug