Fix for random bug