fixed issues: functions