corrected checking for current operation