improve handling in external mode