Fixed some bugs that occured because of I don't know why