Fixing timeout bug