Added code for batch operation