fixed all str_dup ("") to NULL