fixing bugs with empty strings