Fixed minor bug in how a function was being called