use flag instead of existance of Optional