Fixed duplicate flash message error

Resolves #420 and #445