fixed prime bug