The default user directory needed to be used. So I removed the line that sets the user directory, now it works.