undefined check was retarded, fixed it