Fix incorrect usage of order function