fixed some bugs for the future