Fixed null pointers and preview after lock screen