bugfix with double precision