crash fix

payload isnt an array in here
added err checks