fixed some functionilty issues