fixed issues 7 and add test for empty payload