changed some conditions