Handle function like object (due to weird headless browser)