added a method to check if a prefix exists