fox for wrong total_entries in pagination of ative models
fix for attachment