fixed bugs. and more bugs