added string trimming