Added onload support for apps.