Added check to render function to make sure program is ready before use.