Moved clearing of payload to top