start external script with sending data through stdin improved