swapping args to avoid pg issue (could not determine data type of parameter)