Fix crashes on first run of app

Signed-off-by: Umair Khan <omerjerk@gmail.com>