adding extra check to  the changes and aboid starnges behaviors