Fixed function for draw detection
Fixed function for draw detection