added constructor with ip