adding error logging and running of apps