Fixed function dependency bug