added code to handle particular pattern