Fixed issue with registering directive multiple times