bug fix - first space removed from pattern