fixed null pointer exceptions when adding listener
to spinner