Bugfix in procedure.