close functionality is improved