check result before proceeding