Removing nil's from the resources array before sorting