fixed some buggs