added try block in OnPaint in case bitmpa is not yet initialized