minor improvement to stack controller