Fixed a bug where the wrong function was being called