Fixed duplicate db entry issue
removed extra connection check