better logic for completed