fixed some bugs introduced by the 'panels'