Added global js function to apps