added gurad against empty json payload