fix when init directive closed
adding dependencies