Prevent infinite loop on build()

Prevent infinite loop on while trying build all classes