add necessary loaded() function
also support link to target lib