change deprecated :conditions to code block