Made some changes that fix the weird rendering problem