fix issues not sorting correctly