added payload method and fixed indentation