fix crash bug

program crashes when writes data to redis