fixed some buggs like a boss