Added smart custo detection