updated deprecrated code
added debug
added log model and made function and link to app model