taking out race condition and useIP