added close button, connectivity check, fixed bugs