implementing lokcing hashtable functions