fixed conditional problem