added close() method when checkavailability method is recalled.