use instanceof insteed of constractor