Bug fixed the put collection function, rollback still not tested