avoid nullpointer in Select