picking layout from database