fixed some few bugs