changed if clause check from 'true' to true