fixed some Bugs