fix db query issue for remote host