switching js hierarchy to check for dependency errors