attempt 1
fixed missed if nothing to be done