Added support for batch. Test case is also added.