Add logging
Patch to work with HTTPS
Check if sort is defined