optimized with a if http or not command