fixed bug with screenless execution and infinite loop