fixing orders functionality