got rid of the seg fault