fixed broken func