Added transaction function to check IDs in firebase.