Fixed nullpointer exception when adding pinlisteners