checkempty for pattern added