kinda fixed it but the returns None case needs to be handled