Made changes to make app not crash