removed assignments inside conditional checks
merging back into dev