Added code to handle case of a box region