fixed a bug with auto-sizing and rendering hidden content