correctly pulling department info from database