modified bar directive to accept key/val objects