Added additional check cause in testing env remote_addr is set to None