fixing few bugs