Change database function execution, it works