added run loop once functionality