fixed undefined stuff