try to fix error when using empty on a function return