added cast + user logic