Man mistakenly released from jail after assuming another inmate's identity