Fixed mode() for good! It works properly now.