add code to check func ret for fixing prevent issue