fixed few bugs.