Fixed decide function