add rule button behaviour