fixing bug in dahuapp main module