fixes in logic