adding directive functionality