bug fixed + minor changes