Fixes crash in updateBitmap