Potential crashing bug fix