fixed minor bug with complete square