Added some logging. Fixed a problem of converting IP to int when should be string!