implemented better handling of quotes