Fix bug with rendering