fix if statment issue