replace trait variable without json_encode and json_decode value