Updated version. Added empty jQuery object when returning undefined object.