trying to fix last condition