Fix Can't use function return value in write context error