fixing bugs with rendering