few bugs fixes