complete the functionality of g_install method