Fixed logger and added ip address validation