Error in function createRefMarkUp