Change cancel() to close()