Waqf of Masjids and their lands

Permissibility of spending the remaining money dedicated for building a Masjid to build another Masjid