Optimised code

Return false if flashmessage does not exsist. By this i've removed the else conditions