better sub handling