updated app add function