further code cleaned ip loggin function