FIXED SOME BUGS