changed logic