gingerbread crash fixed
refactoring