Fix crash in sample app