minor changes in redering logic