Added src function
Enable cookies for all requests
Fix: check whether element is empty or not before applying function