add condition check for $moduleDetail