add rendering logic