fix undefined offset error in select field