added max size error handling