Added support for autoresizing