fixed position of clear call in main render method (closes #468)