fixed problem with references