Fixing flash error problem