logic correction