Updated with some IP checks - fixed string concat