added payload flag and fixed indentation