Did boundary checking on the selected region in 'updateMask' to prevent out of bounds freezing problems