Updated to handle system messages