bug fixing

fixed some bugs