Bug fix issue1255

Solution to a small bug reported here: https://github.com/kivy/kivy/issues/1255