fixed undefined player error