Calling wrong function