Check for Null Jquery Object

Added check for null jquery obejct