added if mypaper not null because paper will be null when panel get
created