Added code to handle transaction type