Added logging
Fixed duplicate issue