added timeout and max size as configuration