Fixing bugs on redering